﻿create or replace package PKG_STDCODE_GROUP is

  -- Author  : HY
  -- Created : 2012-12-04 오후 1:07:54
  -- Purpose : 코드그룹 패키지 (추가, 수정, 삭제)

  -- Public function and procedure declarations
  procedure ADD_STDCODE_GROUP (NAME_IN IN VARCHAR2, DESCRIPTION_IN IN VARCHAR2, FIXED_IN IN NUMBER, CREATE_USER_IN NUMBER);
  procedure UPDATE_STDCODE_GROUP (OBJECTID_IN IN NUMBER, NAME_IN IN VARCHAR2, DESCRIPTION_IN IN VARCHAR2, STATE_IN IN NUMBER, FIXED_IN IN NUMBER, MODIFY_USER_IN IN NUMBER);
  procedure DELETE_STDCODE_GROUP (OBJECTID_IN IN NUMBER);
end PKG_STDCODE_GROUP;







create or replace package body PKG_STDCODE_GROUP as

  -- Function and procedure implementations
  -- 추가
  procedure ADD_STDCODE_GROUP (NAME_IN IN VARCHAR2, DESCRIPTION_IN IN VARCHAR2, FIXED_IN IN NUMBER, CREATE_USER_IN NUMBER) is
  begin
       INSERT INTO STDCODE_GROUP (OBJECTID, NAME, DESCRIPTION, FIXED, CREATE_USER)
       VALUES (SEQ_STDCODE_GROUP.NEXTVAL, NAME_IN, DESCRIPTION_IN, FIXED_IN, CREATE_USER_IN);
  end ADD_STDCODE_GROUP;

  -- 수정
  procedure UPDATE_STDCODE_GROUP (OBJECTID_IN IN NUMBER, NAME_IN IN VARCHAR2, DESCRIPTION_IN IN VARCHAR2, STATE_IN IN NUMBER, FIXED_IN IN NUMBER, MODIFY_USER_IN IN NUMBER) is
  begin
       UPDATE STDCODE_GROUP A SET A.NAME = NAME_IN, A.DESCRIPTION = DESCRIPTION_IN, A.STATE = STATE_IN, A.FIXED = FIXED_IN, A.MODIFY_DATE = SYSDATE, A.MODIFY_USER = MODIFY_USER_IN WHERE A.OBJECTID = OBJECTID_IN;
  end UPDATE_STDCODE_GROUP;

  -- 삭제
  procedure DELETE_STDCODE_GROUP (OBJECTID_IN IN NUMBER) is
  begin
       DELETE FROM STDCODE_GROUP A WHERE A.OBJECTID = OBJECTID_IN;
  end DELETE_STDCODE_GROUP;
end PKG_STDCODE_GROUP;
